#include "trap.h"
#include "include/shift_test.h"
   .set noat
   .globl main
   .set noreorder
   .text
main:

    TEST_SLLV(0xFFFFFFFF, 0x00000001, 0xFFFFFFFE)
    TEST_SLLV(0xFFFFFFFF, 0x0000001F,0x80000000)
    TEST_SLLV(0x0000FFFF, 0x00000010,0xFFFF0000)
    TEST_SLLV(0x0000FFFF, 0x00000000,0x0000FFFF)
    TEST_SLLV(0x56785678, 0x00000000, 0x56785678)
    TEST_SLLV(0x56785678, 0xFFFFFF80, 0x56785678)

    TEST_SLL(0x0000FFFF, 0x00000010, 0xFFFF0000)
    TEST_SLL(0x0000FFFF, 0x0000001F, 0x80000000)
    TEST_SLL(0X00001234, 0x12341234, 0x23400000) # produce warning, but can be compiled
    TEST_SLL(0x12341234, 0x1234441F, 0x00000000) # produce warning, but can be compiled
    TEST_SLL(0x56785678, 0x00000000, 0x56785678)
    TEST_SLL(0x56785678, 0xFFFFFF80, 0x56785678)# produce warning, but can be compiled

   TEST_SRAV(0x12341234, 0x0000FFFF,0x00000000)
   TEST_SRAV(0xFFFFFFFF, 0x0000FFFF, 0xFFFFFFFF)
   TEST_SRAV(0x00008000, 0x0000000F, 0x00000001)
   TEST_SRAV(0xAAAAAAAA, 0x00000010, 0xFFFFAAAA)
   TEST_SRAV(0x56785678, 0x00000000, 0x56785678)
   TEST_SRAV(0x56785678, 0xFFFFFF80, 0x56785678)

   TEST_SRA(0xFFFFFFFF, 0x0000001F, 0xFFFFFFFF)
   TEST_SRA(0x12341234, 0x00000010, 0x00001234)
   TEST_SRA(0x12341234, 0x12341110, 0x00001234)# produce warning, but can be compiled
   TEST_SRA(0x12341234, 0x00000000, 0x12341234)
   TEST_SRA(0x56785678, 0xFFFFFF80, 0x56785678)# produce warning, but can be compiled
   TEST_SRA(0xAAAAAAAA, 0xFFFFFF1F, 0xFFFFFFFF)# produce warning, but can be compiled

   TEST_SRLV(0xFFFFFFFF, 0x0000001F, 0x00000001)
   TEST_SRLV(0x12341234, 0x0000001F, 0x00000000)
   TEST_SRLV(0x12341234, 0x00000000, 0x12341234)
   TEST_SRLV(0x56785678, 0xFFFFFF80, 0x56785678)
   TEST_SRLV(0xAAAAAAAA, 0xFFFFFF1F, 0x00000001)

   TEST_SRL(0xFFFFFFFF, 0x0000001F, 0x00000001)
   TEST_SRL(0x12341234, 0x00000010, 0x00001234)
   TEST_SRL(0x12341234, 0x12341110, 0x00001234)# produce warning, but can be compiled
   TEST_SRL(0x56785678, 0xFFFFFF80, 0x56785678)# produce warning, but can be compiled
   TEST_SRL(0xAAAAAAAA, 0xFFFFFF1F, 0x00000001)# produce warning, but can be compiled

   HIT_GOOD_TRAP		#stop temu

inst_error:
   HIT_BAD_TRAP #report wrong